<p style="height: 5px;"></p>
			<div id="top" class="easyui-panel" title="顾客信息" data-options="cls:'theme-panel-orange'" style="width:100%;height:380px;padding:10px;">
				<table border="0" style="width:100%;">
					<input type="hidden"  id="customerIds"  name="customerIds"  value="${customerIds!}"/>
					<input   id="amount"  name="customerAgreement.cost"   readonly="readonly"   />
					<tr>
						<td  style="width: 15%">
							姓名：<input class="easyui-textbox inputBox theme-textbox-radius" name="temporary.name"  id="tem_name" value="${temporary.name !}"  
							data-options="
							url:'${cxt!}/bentryRegister/getCusInfo',
							method:'post',
							valueField:'name',
							textField:'name'
							">
						</td>
						
						<td>
							手机：<input class="easyui-combobox inputBox theme-textbox-radius" name="temporary.phone"  id="tem_phone"   value="${temporary.phone !}"  
							data-options="
							url:'${cxt!}/bentryRegister/getCusInfo',
							method:'post',
							valueField:'phone',
							textField:'phone'
							">
								
						</td>
						
						<td>
							性别：<select id="tem_sex" name="temporary.sex" class="easyui-combobox inputBox theme-textbox-radius" panelHeight="auto" data-options="editable: false">
										<option value="女">女</option>
										<option value="男">男</option>
								</select>
						</td>
					
						<td>
							年龄：<input id="tem_age" name="temporary.age" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.age !}" data-options="increment:1,min:1,max:100,label:'岁'" labelPosition="after"></input>
						</td>
						<td >
							身高：<input id="tem_height" name="temporary.height" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.height !}" data-options="increment:1,min:100,max:251,label:'cm'" labelPosition="after"></input>
						</td>
						<td style="width:20%">
							体重：<input id="tem_weight" name="temporary.weight" class="easyui-numberspinner inputBox theme-textbox-radius" value="${temporary.weight !}" data-options="increment:0.1,min:1,label:'斤',precision:1" labelPosition="after"></input>
							<a  class="easyui-linkbutton" data-options="" onclick="mesure()">测算</a>
						</td>
						
					</tr>
					
					<tr>
					
						<td >
							标准：<input id="stantardWeight" name="customerAgreement.std_weight"  class="easyui-textbox inputBox theme-textbox-radius" readonly="readonly"  data-options="label:'斤'" labelPosition="after" value="${temporaryAgreement.std_weight !}"> 
						</td>
						<td >
							目标：<input id="goalWeight" name="targetWeight" class="easyui-textbox inputBox theme-textbox-radius"   data-options="label:'斤',panelHeight:'0'" labelPosition="after" value="${temporaryDetail.delweight !}" >
						</td>
						<td >
							应减：<input id="loseWeight" name = "delWeight" class="easyui-textbox inputBox theme-textbox-radius" readonly="readonly"  data-options="label:'斤'" labelPosition="after" value="${temporaryDetail.delweight !}">
						</td>
						<td>
							周期：<input id="target_input"  name="customerAgreement.target"  class="easyui-numberspinner inputBox theme-textbox-radius"   data-options="increment:1,min:0,max:24,label:'月'" labelPosition="after" >
						</td>
						<td>
							疗程：<input id="lcNumber" name="customerAgreement.treatment"  class="easyui-textbox inputBox theme-textbox-radius"   value="${temporaryAgreement.treatment !}">
						</td>
						<td>
							负责人<#organization type="select" id="cp_select" name="chargePersion" organization="${organids! }" defaultCode="${userids !}"   class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
					</tr>
					
					
					
					<tr>
						<td>购买：<select class="easyui-combobox inputBox theme-textbox-radius"  name="customerAgreement.codeIds"  id="areacodeIds" >
									<option value="" >--请选择--</option>  
									<%for( p in productlist){%>
										<option value='${p.productids! },${p.outprice!}' id='${p.productids! }'  >${p.productname! }</option>  
									<%}%>
									<option  value='0'  >塑性</option>  
								</select>
						</td>
						<td>数量：
							<input id="cusAgree_treatment" name="customerAgreement.treatment" readonly="true"   class="easyui-textbox  inputBox theme-textbox-radius"  >
						</td>
						<td >金额：
							<input id="cusAgree_cost" name="customerAgreement.cost" readonly="true"   class="easyui-textbox  inputBox  inputBox   theme-textbox-radius"  >
						</td>
						
						<td >本号：
							<input id="cusAgree_benhao" name="customerDetail.benhao"   class="easyui-textbox  inputBox     theme-textbox-radius"  >
						</td>
					</tr>
					
					
					
					
					<tr>
						<td >编号：
							<input id="cusAgree_benhao" name="customerDetail.benhao"   class="easyui-textbox  inputBox     theme-textbox-radius"  >
						</td>
						<td>膏剩余<input id="cusAgree_treatment" name="customerAgreement.treatment"    class="easyui-textbox  inputBox theme-textbox-radius"  >
						</td>
						<td>到期：
							<input id="cusAgree_treatment"  class="easyui-datebox inputBox theme-textbox-radius"   data-options="sharedCalendar:'#cc'"  >
						</td>
						<td>油剩余
							<input id="cusAgree_cost" name="customerAgreement.cost"  class="easyui-textbox  inputBox  inputBox   theme-textbox-radius"  >
						</td>
						<td >到期：
							<input id="cusAgree_benhao"  class="easyui-datebox inputBox theme-textbox-radius"   data-options="sharedCalendar:'#cc'"  >
						</td>
					</tr>
					
					
				
					<tr>
						<td>
							接待人<#organization type="select" id="jdr_select" name="temporary.jdr"  defaultCode="${userids !}" class="easyui-combobox inputBox theme-textbox-radius" organization="${organids! }"/>
						</td>
						<td>
							反馈：<#code type="select" id="gkfy_select" name="temporary.gkfy" code="code_gkfy" defaultCode="${temporary.gkfy! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
						<td>
							方式：<#code type="select" id="jdfs_select" name="temporary.jdfs" code="code_jdfs" defaultCode="${temporary.jdfs! }"  class="easyui-combobox inputBox theme-textbox-radius" />
						</td>
					
						
						
						<td id="jsrNametd" >
								 <input id="jsrIds" type="hidden" name="temporary.jsrIds" value="${temporary.jsrIds !}" >
								 <input id="jsrtype" type="hidden" name="temporary.jsrtype" value="${temporary.jsrtype !}" >
							介绍人<input id="jsrName"  name="temporary.jsrName"  class="easyui-combobox inputBox theme-textbox-radius" value="${temporary.name !}"  
							
							data-options="
							url:'collectionMeasurement/getCusAndUserInfo',
							method:'post',
							valueField:'name',
							textField:'name'"
							>
						</td>
						
						
						<td id="jsrPhonetd"  style="width: 17%">
							介绍人手机<input class="easyui-combobox inputBox theme-textbox-radius" name="temporary.jsrPhone"  id="jsrPhone"   value="${temporary.phone !}"  
							data-options="
							url:'collectionMeasurement/getCusAndUserInfo',
							method:'post',
							valueField:'phone',
							textField:'phone'
							">
						</td>
						
						
						<td   id="jsrStoreNametd" style="width: 17%">	
							介绍人门店<input id="jsrStoreName"   name="temporary.jsrStore"  class="easyui-textbox inputBox theme-textbox-radius"  value="${temporary.organization.name !}" readonly="readonly">
						</td>
					</tr>
					
				
						
					<tr>
						<td >身份证
							<input name="customerDetail.sfzmhm" class="easyui-textbox  inputBox theme-textbox-radius"    value="${customer.sfzmhm! }">
						</td>
						<td >生日：
							<input name="customerDetail.birth" class="easyui-datebox inputBox theme-textbox-radius"   data-options="sharedCalendar:'#cc'" >
						</td>
						<td >职业：
							<input name="customerDetail.job" class="easyui-textbox inputBox  theme-textbox-radius"    value="${customer.customerDetail.job! }">
						</td>
						
					</tr>
				
				
					<tr>
						<td colspan="5">住址：
							 	<#code type="select" id="xzqh_select" name="customerDetail.provice" code="code_xzqh"  style="width:150px"       class="easyui-combobox inputBox theme-textbox-radius" />
								<input id="city_input" type="hidden"   style="width:210px">
								<input id="city_combobox" name="customerDetail.city" class="easyui-combobox inputBox theme-textbox-radius" />
								<input id="area_input" type="hidden" >
								<input id="area_combobox" name="customerDetail.area" class="easyui-combobox inputBox theme-textbox-radius" />
								<input class="easyui-textbox theme-textbox-radius"    name="customerDetail.address" style="width: 140px;" >
						</td>
					</tr>
					
				
					<tr>
						<td  colspan="3">
						<a href="#" class="easyui-linkbutton" style="background: #00A65A;color: white;" onclick="chakan(1)">正面查看</a>
						<input id="zmfile"  name="zmfile"  type="file"  onchange="imgPreview()"    accept="image/jpeg,image/png,image/gif"  >		
						<!-- <input id="zmfile"  name="zmfile" class="easyui-filebox"    accept="image/jpeg,image/png,image/gif"  style="width:250px" data-options="onChange:function(){upload()}, buttonText:'正面上传照',prompt:'请选择文件...'">		 -->
						</td>	
							
						<td colspan="3">	
						<a href="#" class="easyui-linkbutton" style="background: #00A65A;color: white;" onclick="chakan(2)">侧面查看</a>					
						<input id="cmfile"  name="cmfile" type="file"  onchange="imgPreview1()"  accept="image/jpeg,image/png,image/gif"  >		
						<!-- <input id="cmfile"  name="cmfile" class="easyui-filebox"   accept="image/jpeg,image/png,image/gif"  style="width:250px" data-options="onChange:function(){upload()},buttonText:'侧面上传照',prompt:'请选择文件...'"> -->		
						</td>
					</tr>
					
					
					
				</table>
				</div>
			
			
			<p style="height: 5px;"></p>
				<a  class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="save()" style="margin-left: 40%;margin-top: 20px;width:150px;height: 35px">保存</a>
				
		
		<div id="picture" class="easyui-window" data-options="collapsible:false,minimizable:false,maximizable:false,closable:true,resizable:false" title="查看照片" style="width:500px;height:500px;padding:5px;" closed="true">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:10px;">
						
						<div id="preview">
							<img  id="zmpicture" style="height: 100%;width: 100%;" />
							<img  id="cmpicture" style="height: 100%;width: 100%;" />
						</div>
					</div>
				</div>
		</div>
		<script src="${cxt !}/sb/js/ajaxfileupload.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
	
	function  chakan(type){
		$('#picture').window('open');
		if(type==1)
		{
			$('#zmpicture').css("display","block");
			$('#cmpicture').css("display","none");
		}
		if(type==2)
		{
			$('#zmpicture').css("display","none");
			$('#cmpicture').css("display","block");
		}
	}
	
	$(document).ready(function () {
		//省份改变选择城市
		$('#xzqh_select').combobox({

			onChange: function (n,o) {
				getCity(n);
			},
		onSelect: function (n) 
		 {		
			 var newPtion = $('#xzqh_select').combobox('getValue');
			 getCity(newPtion);
		 }

		});
		//市改变选择区
		$('#city_combobox').combobox({

			onChange: function (n,o) {
				getArea(n);
			}
			
		});
		
		
		$('#areacodeIds').combobox({
			onChange: function (n,o) {
				
				if(n==null||n==''){
					$.alert(parent.$, "请选择购买产品！");
					$('#cusAgree_treatment').textbox('setValue','');
					$('#cusAgree_cost').textbox('setValue','');
					return false;
				}
				var sjtreatment =  $('#lcNumber').val();
				if(sjtreatment==null||sjtreatment==''){
					$.alert(parent.$, "请填写测算信息！");
					return false;
				}
				if(n.indexOf('27aeb2d41d044394b9b58f6814baa4fa')>=0){//一疗程
						$('#cusAgree_treatment').textbox('setValue','1');
						$('#cusAgree_cost').textbox('setValue',n.split(',')[1]);
				}else if(n.indexOf('0896ce4d4970455d9184e6dd1ced6a0e')>=0){//标准疗程
						$('#cusAgree_treatment').textbox('setValue',sjtreatment);
						$('#cusAgree_cost').textbox('setValue',n.split(',')[1]*sjtreatment);
				}else if(n.indexOf('4777c2c215b6408ab13c1eac4190ce46')>=0){//单疗程
					$('#cusAgree_cost').textbox('setValue',n.split(',')[1]);
					$('#cusAgree_treatment').textbox('setValue','1');
				}else if(n=='0'){//塑性
					$('#cusAgree_cost').textbox('setValue','0');
					$('#cusAgree_treatment').textbox('setValue','0');
				}
				
			}
		});	
		

	
	});	
	
	//获取城市
	function  getCity(n)
	{
		var url = "/bentryRegister/getChild";
		var data={"codeIds":n};
		var reData = common_ajax.ajaxFunc(url,data,"json");
		var city=$("#city_input").val();
		var com=$('#city_combobox');
		select(reData,com,city);
	}
	//获取区
	function  getArea(n)
	{
		var url = "/bentryRegister/getChild";
		var data={"codeIds":n};
		var reData = common_ajax.ajaxFunc(url,data,"json");
		var area=$("#area_input").val();
		var com=$('#area_combobox');
		select(reData,com,area);
	}
	
	function imgPreview1(){
    	var fileDom = document.getElementById("cmfile");
        //判断是否支持FileReader
        if (window.FileReader) {
            var reader = new FileReader();
        } else {
            alert("您的设备不支持图片预览功能，如需该功能请升级您的设备！");
        }
        //获取文件
        var file = fileDom.files[0];
        var imageType = /^image\//;
        //是否是图片
        if (!imageType.test(file.type)) {
            alert("请选择图片！");
            return false;
        }
        //读取完成
        reader.onload = function(e) {
            //获取图片dom
            var img = document.getElementById("cmpicture");
            //图片路径设置为读取的图片
            img.src = e.target.result;
        };
        reader.readAsDataURL(file);
       
        upload('beforecm','cmfile');
    }
    
	
	
	
	
	
	
    function imgPreview(){
    	var fileDom = document.getElementById("zmfile");
        //判断是否支持FileReader
        if (window.FileReader) {
            var reader = new FileReader();
        } else {
            alert("您的设备不支持图片预览功能，如需该功能请升级您的设备！");
        }
        //获取文件
        var file = fileDom.files[0];
        var imageType = /^image\//;
        //是否是图片
        if (!imageType.test(file.type)) {
            alert("请选择图片！");
            return false;
        }
        //读取完成
        reader.onload = function(e) {
            //获取图片dom
            var img = document.getElementById("zmpicture");
            //图片路径设置为读取的图片
            img.src = e.target.result;
        };
        reader.readAsDataURL(file);
       
        upload('beforezm','zmfile');
    }
    
    
	
	//--------上传图片
	function upload(flag,zp){	
		var customerIds=$('#customerIds').val()+flag;
		 $.ajaxFileUpload({
		        url : '${cxt !}/bentryRegister/imageUpload',   //提交的路径
		        secureuri : false, // 是否启用安全提交，默认为false
		        fileElementId :[zp], // file控件id
//					         fileElementId :'zmfile',
		        dataType : 'json',
		        data : {customerIds : customerIds}, // 键:值，传递文件名
		        success : function(result, status) {
		        	if (result.status == 0) {
		        		$.slideMsg("保存成功", parent.$);
//					                var src = data.src;
//					                $('#show').append("<img src='" + src + "'>");  //显示图片

//					                // 存储已上传图片地址
//					                var oldSrc = $('#pictureSrc').val();
//					                var newSrc = "";
//					                if (oldSrc != "")
//					                    newSrc = oldSrc + ";" + src;
//					                else
//					                    newSrc = src;

//					                $('#pictureSrc').val(newSrc);   //保存路径
		            } 
		        	if(result.status == 1){
		                $.alert(parent.$, result.message);
		            }
		        	if(result.status == 2){
		        		$.slideMsg(result.message, parent.$);
		        	}
		        },
		        error : function(data, status) {
		        	$.alert(parent.$, "只允许上传png,jpg,jpeg,gif,bmp类型的图片文件！");
		        }
		    });
	}
	
    
    
    
    
    
    
    
    
    
    
    
    
    function file1234(f,id){
    	if(f.value!=''){
    		var formData = new FormData($("#"+id)[0]); 
    	    $.ajax({ 
    	         url : '${cxt !}/bentryRegister/imageUpload?customerIds=1', 
    	         type: 'post', 
    	         data: formData,
    	         async: false, 
    	         cache: false, 
    	         contentType: false, 
    	         processData: false, 
    	         dataType: "json",  
    	         success: function (returndata) { 
    		          if(returndata.status==1){
    					savePhoto(id,f.value.substring(f.value.lastIndexOf('\\')+1,f.value.lenght), returndata.filename)	
    		          }else if(returndata.status==2){
    		          	layer.msg('文件大小超过100M!');
    		          }else if(returndata.status==3){
    		          	layer.msg('文件格式不正确!');
    		          }else{
    		        	  layer.msg('上传失败!');
    		          }
    	         }, 
    	         error: function (returndata) { 
    	        	 layer.msg('上传失败!') ;
    	         } 
    	    });  
    	}
    }

    
</script>
		
		
		
		
		
		
		
		
		
		
		
		
				
	<script  type="text/javascript" charset="utf-8">

	$(document).ready(function () {
		
		$("#tem_name").combobox({
			onChange: function (n,o) {
				if(n.length>=2&&n.length<5){
					
					searchInfo(n,null)
				}
			}
		});
		$("#tem_phone").combobox({
			onChange: function (n,o) {
				if(n.length==11){
					
					searchInfo(null,n)
				}

			}
		});
		$("#jsrPhone").combobox({
			onChange: function (n,o) {
				if(n.length==11){
					
					selStore(n)
				}

			}
		});
		
		
		$("#jsrName").combobox({
			onChange: function (n,o) {
				if(n.length==1){
					
					selStore(n)
				}

			}
		});
		
		
	});
	
		function  searchInfo(name,phone){
			//alert(1111)
			$('#dhhfbottom').panel('close'); 
			$('#ddfwbottom').panel('close'); 
			var url='/collectionMeasurement/phoneSearch';
			var data={"phone":phone,"name":name};
			var reData = common_ajax.ajaxFunc(url,data,"json");
			//alert(1111)
			if(reData.msg==200){
				
				$("#callvisitcount").html(reData.callvisitcount);
				$("#toshopvisitcount").html(reData.toshopvisitcount);
				$("#tem_name").textbox('setValue',reData.name);
				$("#tem_sex").textbox('setValue',reData.sex);
				$("#tem_phone").textbox('setValue',reData.phone);
				$("#tem_age").textbox('setValue',reData.age);
				$("#tem_height").textbox('setValue',reData.height);
				$("#tem_weight").textbox('setValue',reData.weight);
				$("#loseWeight").textbox('setValue',reData.delWeight);
				$("#lcNumber").textbox('setValue',reData.treatment);
				$("#goalWeight").textbox('setValue',reData.targetWeight);
				
				$("#amount").textbox('setValue',reData.cost);
				
				$("#target_input").textbox('setValue',reData.weightDay);
				$("#stantardWeight").textbox('setValue',reData.standWeight);
				$("#jdr_select").combobox('setValue',reData.jdr);
				$("#gkfy_select").combobox('setValue',reData.gkfy);
				$("#jdfs_select").combobox('setValue',reData.jdfs);
				$("#wcjyy_select").combobox('setValue',reData.loseReason);
				
				$("#jsrName").textbox('setValue',reData.jsrName);
				$("#jsrPhone").textbox('setValue',reData.jsrPhone);
				$("#jsrStoreName").textbox('setValue',reData.jsrStore);
				$("#gkfl_select").combobox('setValue',reData.gkfl);
				
			
			return  reData; 
		}}
		</script>		